#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2020/1/29 下午11:55
# @Author : ZhouChuang
# @Site : 
# @File : forms.py
# @Software: PyCharm
from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField, PasswordField
from wtforms.validators import DataRequired, Length


class AddMovieForm(FlaskForm):
    title = StringField('Movie', validators=[DataRequired(), Length(0, 20)])
    year = StringField('Year', validators=[DataRequired(), Length(0, 4)])
    submit = SubmitField('Submit')


class LoginForm(FlaskForm):
    username = StringField('Username', validators=[DataRequired()])
    password = PasswordField('Password', validators=[DataRequired()])
    submit = SubmitField('提交')


class SettingForm(FlaskForm):
    name = StringField('Your Name', validators=[DataRequired(), Length(0, 20)])
    submit = SubmitField('保存')


class EditMovieForm(FlaskForm):
    title = StringField('Movie', validators=[DataRequired(), Length(0, 20)])
    year = StringField('Year', validators=[DataRequired(), Length(0, 4)])
    submit = SubmitField('Update')
